package com.fenghongzhang.day014;

import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.util.Log;

public class MyService extends Service {
    private static final String TAG = "MyService";
    
    public MyService() {
    }


    @Override
    public void onCreate() {
        super.onCreate();
        Log.i(TAG, "onCreate: ");
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        Log.i(TAG, "onStartCommand: ");

        return super.onStartCommand(intent, flags, startId);
    }


    //代理人
    class MyBinder extends Binder{
        public void callShow(){
            show();
        }
        public void callShow2(){
            show2();
        }
    }
    @Override
    public IBinder onBind(Intent intent) {
        Log.i(TAG, "onBind: ");
        return new MyBinder();
    }

    @Override
    public boolean onUnbind(Intent intent) {
        Log.i(TAG, "onUnbind: ");
        return super.onUnbind(intent);
        
    }

    public void show(){
        Log.i(TAG, "show: ");
    }

    public void show2(){
        Log.i(TAG, "show: 222");
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        Log.i(TAG, "onDestroy: ");
    }



}
